// 前台 发现模块 的axios封装 发请求

import myaxios from './MyAxios.js'

// 服务器地址
const baseUrl = "http://43.136.172.73/api/v1/"

const OrderApi = {
	// 查询新增预约订单
	queryNewOrder() {
		let url = baseUrl + 'reservation/getValue'
		return myaxios.get(url)
	},

	// 查询全部预约单
	queryAllOrderList(params) {
		let url = baseUrl + '/reservation/getReservationList';
		return myaxios.post(url, params);
	},
	// 查询不同状态预约单
	queryOrderList(params) {
		let url = baseUrl + '/reservation/getReservationStateList';
		return myaxios.post(url, params);
	},

	// 根据预约订单id查询具体订单
	queryDetailsOrder(params) {
		let url = baseUrl + '/reservation/query/' + params
		return myaxios.get(url)
	},

	// 根据预约订单id查询具体订单
	queryCancelOrder(params) {
		let url = baseUrl + '/reservation/cancelReservation/' + params
		return myaxios.get(url)
	},

	// 添加备注
	queryRemark(params) {
		let url = baseUrl + '/reservation/remark'
		return myaxios.post(url, params)
	},
	//根据门店id查询门店订单
	queryOrderByStoreId(params) {
		let url = baseUrl + '/reservation/getReservationRequestList/' + params
		return myaxios.get(url)
	},


	// 查询回收店列表
	queryStore() {
		let url = baseUrl + '/system/GbStation/selectAll/'
		return myaxios.get(url)

	},
	//根据骑手id和店铺id查询订单
	queryStoreIdUserId(params) {
		let url = baseUrl + '/reservation/getDoReservationList'
		return myaxios.post(url, params)
	},
	//存储用户定位信息
	putUserGPS(params) {
		let url = baseUrl + '/account/modify'
		return myaxios.put(url, params)
	},

	//查询用户列表
	queryUser(params) {
		let url = 'https://www.gclive.cloud/api/v1/account/' + params

		return myaxios.get(url)
	},

	//确定下单
	submitOrder(params) {
		let url = baseUrl + '/reservation/endReservation'
		return myaxios.post(url, params)
	},

	//骑手接单
	action(params) {
		let url = baseUrl + '/reservation/doGrab'
		return myaxios.post(url, params)
	},
	//查询店铺已取消订单
	cancelStore(params) {
		let url = baseUrl + '/reservation/getCancelReservationList/' + params
		return myaxios.post(url)
	},
	//升级vip
	payVip(params1, params2) {
		let url = `https://www.gclive.cloud/api/v1/user/upgrade?userId=${params1}&money=${params2}`
		return myaxios.put(url)
	},

	//获取地址
	getAddress(params) {
		let url = `http://www.gclive.cloud/api/v1/address/load?userId=${params}`
		return myaxios.get(url)
	},

	//新增预约单
	newOrder(params) {
		let url = baseUrl + '/reservation/addReservation'
		return myaxios.post(url, params)
	},
	//登录
	goLogin(params) {
		let url = baseUrl + '/auth/login'
		return myaxios.post(url, params)
	},




}

export default OrderApi;